<template>
    <div class="tabbar">
        <van-tabbar v-model="active">
            <van-tabbar-item
            v-for="tab in tabList"
            :key="tab.path"
            :to="tab.path"
            :icon="tab.icon">{{tab.title}}</van-tabbar-item>
        </van-tabbar>
    </div>
</template>

<script>
import routes from '@/router/routes'
export default {
  name: 'Tabbar',

  data () {
    return {
      active: 0,
      tabList: [],
    }
  },
  created () {
    this.tabList = routes.filter(item => item.meta?.intabbar).map(tab => {
      return {
        icon: tab.meta.icon,
        title: tab.meta.title,
        path: tab.path,
      }
    })
  },

  mounted () {

  },

  methods: {

  },
}
</script>

<style lang="less" scoped>

</style>
